﻿using System;
using System.Text;
using System.IO;

namespace RolePlayingGame
{
    public class MapInterpreter
    {
        /* takes a text file which holds values for _leftborder_ _rightborder_ of the map "river" 
         * and places the boundaries on the console on the top line. 
         * Also places Items and Enemies on the top line (but whether they're rendered or not depends on visibility) 
         */

        private string mapFilePath;

        public void LoadFullMap()
        { 
            throw new NotImplementedException();

            //creates a List<string> and fills it with the DecodeLine()
        }

        public static string NextLine() 
        { 
            throw new NotImplementedException();
        }


        private static string DecodeLine(string line)
        {
            throw new NotImplementedException("DecodeLine() in MapInterpreter!");
            
            //takes a line with syntax: ([left] [right] [enemies] [items])
            //25 92 0 1
            //and produces the borders, no enemies and one randomly placed item, in the example below an armour-up
            //----------------)            A   (---------------

            string[] valueStrings = line.Split(' ');
            int[] mapValues = new int[4];
            for (int i = 0; i < 4; i++)
            {
                mapValues[i] = int.Parse(valueStrings[i]);
            }

            int mapWidth = 100;
            var topLine = new StringBuilder(new String('-', mapWidth));

            topLine[mapValues[0]] = ')';
            topLine[mapValues[2]] = '(';
            
            //TO DO: randomly place enemies and items
        }

    }
}
